// pages/index_content/index_content.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrls: [
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516680848&di=81ad7c665cf3d4189dadf2642a9c4f89&imgtype=jpg&er=1&src=http%3A%2F%2Fstatics.juxia.com%2Fuploadfile%2Fcontent%2F2014%2F9%2F2014090211155739.jpg',
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516086127331&di=d6a9c6bdd279593c8195cb3c95ec72a0&imgtype=0&src=http%3A%2F%2Fwww.narutom.com%2Fd%2Ffile%2Fcomic%2F2007-08-22%2F2815bccd97b9088f349048c5cb6f3ea6.jpg',
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516086167725&di=7434a0ead89b5606293064a374f611b7&imgtype=0&src=http%3A%2F%2Fupload.cccnews.com.cn%2F2014%2F0827%2F1409101697771.jpg'
    ],
    text:[{
      id:"1",
      url: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516085498784&di=19f0a47dcbb424ce03c5757f969f0076&imgtype=0&src=http%3A%2F%2Fimgsrc.baidu.com%2Fimgad%2Fpic%2Fitem%2Faa64034f78f0f736565f8df40055b319eac413a6.jpg",
      chapret:"15章节"
    },{
        id:"2",
        url: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516680279&di=9616680b275f880525e33231b80fdaae&imgtype=jpg&er=1&src=http%3A%2F%2Fpic.58pic.com%2F58pic%2F13%2F19%2F56%2F65z58PICVdv_1024.jpg",
        chapret:"20章节"
  
    },{
        id:"3",
        url: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516680304&di=435572dac143df1c12e473032629716d&imgtype=jpg&er=1&src=http%3A%2F%2Fimg2.ph.126.net%2F4VGoh8UsifW2HSGTz8-_PQ%3D%3D%2F6597700886331652514.jpg",
        chapret:"10章节"

    }
 
    ],

    updata:[
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516085834400&di=7504a7ab3d39253e21e3efd06d07f7e8&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D2593357120%2C3909878003%26fm%3D214%26gp%3D0.jpg',
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516085582442&di=844f98ae581bba5e62bfaeb4cb9edbbd&imgtype=0&src=http%3A%2F%2Fyqb.mntp.cc%2FuploaDS1%2F0507%2F20160507osmur2wc03y.jpg',
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516085867362&di=217ad1d6adb3a0efe92e73cdb21c6efb&imgtype=0&src=http%3A%2F%2Fyqb.mntp.cc%2FuploaDS1%2F0728%2F20160122hthpynos3ts.jpg',

    ],
    vip:[
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516086016613&di=a0a8b724cd65af246fc06f7c4d8b9405&imgtype=0&src=http%3A%2F%2Fuploads.xuexila.com%2Fallimg%2F1702%2F867-1F20QI333.png',
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516086016838&di=2242448e9d533c36a3ec0e1ef5ac070c&imgtype=0&src=http%3A%2F%2Fimgsrc.baidu.com%2Fimgad%2Fpic%2Fitem%2F4d086e061d950a7ba10d0f3200d162d9f2d3c908.jpg',
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516086076100&di=2ca6cea3624c45daad33f0a49ea9fdc1&imgtype=0&src=http%3A%2F%2Fis2.mzstatic.com%2Fimage%2Fpf%2Fus%2Fr30%2FPurple1%2Fv4%2F79%2F9a%2Fda%2F799ada47-b180-a56b-d31d-fc747200239e%2Fpr_source.jpg',
    ],
    free:[
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516086241990&di=41519dcdb0ed2a1bd3903b34518f7019&imgtype=0&src=http%3A%2F%2Fpic.qqtn.com%2Fup%2F2017-12%2F15142527504511472.jpg',
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516680998&di=2847a31eabaa438d42d2cc53a1aaee02&imgtype=jpg&er=1&src=http%3A%2F%2Fh.hiphotos.baidu.com%2Fzhidao%2Fpic%2Fitem%2F37d3d539b6003af3ad4c2b4f362ac65c1038b62f.jpg',
      'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516681010&di=c1f61168211f794283c83125b08b9e33&imgtype=jpg&er=1&src=http%3A%2F%2Fg.hiphotos.baidu.com%2Fzhidao%2Fpic%2Fitem%2Fb3b7d0a20cf431ad15c7f83f4d36acaf2edd989b.jpg',
    ],
    

    indicatorDots: false,
    autoplay: false,
    interval: 5000,
    duration: 1000,
    winWidth: 0,
    winHeight: 0,
    currentTab: 0
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    wx.getSystemInfo({
      success: function(res) {
        that.setData({
          winWidth: res.windowWidth,
          winHeight: res.windowHeight
        });
      },
    })  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    this.setData({
      autoplay: !this.data.autoplay
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },
  bindChange: function(e){
    var that = this;
    that.setData({ currentTab: e.detail.current });  
  },
  swichNav: function(e){
    var that = this;

    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current
      })
    }  
  }
})